#include "HttpServlet.h"



const std::string HttpServlet::METHOD_GET = "GET";
const std::string HttpServlet::METHOD_HEAD = "HEAD";
const std::string HttpServlet::METHOD_POST = "POST";
const std::string HttpServlet::METHOD_PUT = "PUT";
const std::string HttpServlet::METHOD_DELETE = "DELETE";
const std::string HttpServlet::METHOD_CONNECT = "CONNECT";
const std::string HttpServlet::METHOD_OPTIONS = "OPTIONS";
const std::string HttpServlet::METHOD_TRACE = "TRACE";
const std::string HttpServlet::METHOD_PATCH = "PATCH";

HttpServlet::HttpServlet() {

}

HttpServlet::~HttpServlet() {

}


void HttpServlet::Service(HttpServletRequest req, HttpServletResponse resp) {
	if (req.GetMethod() == METHOD_GET) {
		DoGet(req, resp);
	}
	else if (req.GetMethod() == METHOD_HEAD) {
		DoHead(req, resp);
	}
	else if (req.GetMethod() == METHOD_POST) {
		DoPost(req, resp);
	}
	else if (req.GetMethod() == METHOD_PUT) {
		DoPut(req, resp);
	}
	else if (req.GetMethod() == METHOD_DELETE) {
		DoDelete(req, resp);
	}
	else if (req.GetMethod() == METHOD_CONNECT) {
		DoConnect(req, resp);
	}
	else if (req.GetMethod() == METHOD_OPTIONS) {
		DoOptions(req, resp);
	}
	else if (req.GetMethod() == METHOD_TRACE) {
		DoTrace(req, resp);
	}
	else if (req.GetMethod() == METHOD_PATCH) {
		DoPatch(req, resp);
	}
	else {
	}
}

void HttpServlet::DoGet(HttpServletRequest req, HttpServletResponse resp) {

}

void HttpServlet::DoHead(HttpServletRequest req, HttpServletResponse resp) {

}

void HttpServlet::DoPost(HttpServletRequest req, HttpServletResponse resp) {

}

void HttpServlet::DoPut(HttpServletRequest req, HttpServletResponse resp) {

}

void HttpServlet::DoDelete(HttpServletRequest req, HttpServletResponse resp) {

}

void HttpServlet::DoConnect(HttpServletRequest req, HttpServletResponse resp) {

}

void HttpServlet::DoOptions(HttpServletRequest req, HttpServletResponse resp) {

}

void HttpServlet::DoTrace(HttpServletRequest req, HttpServletResponse resp) {

}

void HttpServlet::DoPatch(HttpServletRequest req, HttpServletResponse resp) {

}
